//
//  ColorUtility.m
//  Balance
//
//  Created by Sophia Tsay on 6/10/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ColorUtility.h"

@implementation ColorUtility

+ (CAGradientLayer *)buttonGradientLayer
{
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    

    gradientLayer.colors = [NSArray arrayWithObjects:(id)[UIColor colorWithWhite:1.0f alpha:0.4f].CGColor,
                            (id)[UIColor colorWithWhite:1.0f alpha:0.2f].CGColor,
                            (id)[UIColor colorWithWhite:0.75f alpha:0.2f].CGColor,
                            (id)[UIColor colorWithWhite:0.4f alpha:0.2f].CGColor,
                            (id)[UIColor colorWithWhite:1.0f alpha:0.4f].CGColor,
                            nil];
    
    gradientLayer.locations = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0f],
                               [NSNumber numberWithFloat:0.5f],
                               [NSNumber numberWithFloat:0.5f],
                               [NSNumber numberWithFloat:0.8f],
                               [NSNumber numberWithFloat:1.0f],
                               nil];
    
    gradientLayer.cornerRadius = 8.0f;
    gradientLayer.backgroundColor = [[UIColor blackColor] CGColor];
    
    return gradientLayer;
}

+ (CAGradientLayer *)toolBarGradientLayer
{
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    
    
    gradientLayer.colors = [NSArray arrayWithObjects:(id)[UIColor colorWithWhite:0.9f alpha:0.5f].CGColor,
                            (id)[UIColor colorWithWhite:0.9f alpha:0.5f].CGColor,
                            (id)[UIColor colorWithWhite:0.4f alpha:0.5f].CGColor,
                            (id)[UIColor colorWithWhite:0.4f alpha:0.5f].CGColor,
                            (id)[UIColor colorWithWhite:0.4f alpha:0.5f].CGColor,
                            nil];
    
    gradientLayer.locations = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0f],
                               [NSNumber numberWithFloat:0.5f],
                               [NSNumber numberWithFloat:0.5f],
                               [NSNumber numberWithFloat:0.8f],
                               [NSNumber numberWithFloat:1.0f],
                               nil];
    
    gradientLayer.cornerRadius = 8.0f;
    gradientLayer.backgroundColor = [[UIColor blackColor] CGColor];
    gradientLayer.cornerRadius = 0;
    
    return gradientLayer;    
}
@end
